/*
 * @Author: Jone XIn
 * @Date: 2022-01-24 21:12:42
 * @LastEditTime: 2022-01-26 20:20:37
 * @Description: 数据源_test
 */

// 服务端节点图形配置
const defaultServeConfig = {
    size: 120,
    type: "donut",
    donutAttrs: {
        prop1: 10,
        prop2: 20,
        prop3: 25,
    },
    // the color map for drawing donut
    donutColorMap: {
        prop1: "#8eaade",
        prop2: "#5c7cb8",
        prop3: "#1e3f7d",
    },
}

// 每个客户端节点【项目节点】的配置信息
const defaultProjectConfig = {
    type: "donut",
    /* node size */
    size: 60,
    /* style for the keyShape */
    style: {
        fill: "#FFF0F5",
        stroke: "#5B8FF9",
        lineWidth: 3,
    },
    labelCfg: {
        /* label's position, options: center, top, bottom, left, right */
        position: "bottom",
        /* label's offset to the keyShape, 4 by default */
        //   offset: 12,
        /* label's style */
        style: {
            // fontSize: 20,
            fill: "#008B8B",
            // fontWeight: 500,
        },
    },
    icon: { show: true },
}

const defaultMaichineConfig = {
    type: "circle",
    /* node size */
    size: 50,
    /* style for the keyShape */
    style: {
        fill: "#90EE90",
        stroke: "#90EE90",
        lineWidth: 3,
    },
    labelCfg: {
        /* label's position, options: center, top, bottom, left, right */
        position: "bottom",
        /* label's offset to the keyShape, 4 by default */
        offset: 40,
        /* label's style */
        style: {
            // fontSize: 20,
            fill: "",
            // fontWeight: 500,
        },
    },
    /* configurations for four linkpoints */
    linkPoints: {
        top: false,
        right: false,
        bottom: false,
        left: false,
        /* linkPoints' size, 8 by default */
        //   size: 5,
        /* linkPoints' style */
        //   fill: '#ccc',
        //   stroke: '#333',
        //   lineWidth: 2,
    },
    /* icon configuration */
    icon: {
        /* whether show the icon, false by default */
        show: true,
        /* icon's img address, string type */
        img: "./img/computer.svg",
        /* icon's size, 20 * 20 by default: */
        width: 30,
        height: 30,
    },
    /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */
    // nodeStateStyles: {
    //   // node style of active state
    //   active: {
    //     fillOpacity: 0.8,
    //   },
    //   // node style of selected state
    //   selected: {
    //     lineWidth: 5,
    //   },
    // },
}

const data = {
    nodes: [
        {
            id: "node_server",
            label: "Server",
            ...defaultServeConfig
        },
        {
            id: "node1",
            label: "rtp_line_front",
            ...defaultProjectConfig
        },
        {
            id: "node4",
            isLeaf: true,
            label: "设备1",
            ...defaultMaichineConfig
        },
    ],
    edges: [
        { source: "node_server", target: "node1", color: 'red', label: 'ada' },
        { source: "node1", target: "node4" },
    ],
};


export {
    data,
    defaultMaichineConfig,
    defaultProjectConfig,
    defaultServeConfig
}